<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>使用申请</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true"  layout="table" tiptype="3" action="labApplyController.do?doApply" beforeSubmit="validateDate" >
		<input id="id" name="id" type="hidden" value="${lab.id }">
		<table style="" cellpadding="0" cellspacing="1" class="formtable">  
				 
				 <tr>
					<td align="left">
						<label class="Validform_label">
							申请人手机号:
						</label>
					</td>
					<td class="value">
						<input  maxlength="11"  name="applyCellphone" type="text" 
						 class="input" value="${apply.applyCellphone}" datatype="n"> 	  
					</td>
				</tr>

				 
				<tr>
					<td align="left">
						<label class="Validform_label">
							申请用途:
						</label>
					</td>
					<td class="value">
						<textarea id="purpose"  name="purpose" type="text" style="height:130px;width: 200px;" class="textarea" >${apply.purpose}</textarea> 	  
					</td>
				</tr>
				<tr>
					<td align="left">
						<label class="Validform_label">
							开始时间:
						</label>
					</td>
					<td class="value">
						<input    name="beginDate" type="text" 
						 class="input" value="${apply.applyCellphone}" datatype="*" readonly="readonly"> 	  
					</td>
				</tr>
				<tr>
					<td align="left">
						<label class="Validform_label">
							结束时间:
						</label>
					</td>
					<td class="value">
						<input   name="endDate" type="text" 
						 class="input" datatype="*" readonly="readonly"> 	  
					</td>
				</tr>
				 				 
			</table>
		</t:formvalid>

	<script>
		$(document).ready(function(){
			$("input[name='beginDate']").attr("class","Wdate").click(function(){
				WdatePicker({minDate:'${nowDate}', dateFmt:'yyyy-MM-dd HH:mm'});});
			$("input[name='endDate']").attr("class","Wdate").click(function(){
				WdatePicker({minDate:'${nowDate}',dateFmt:'yyyy-MM-dd HH:mm'});});
		});
		
		function validateDate(){
			if($("input[name='beginDate']").val()==""){
				tip("请选择开始时间");
				return false;
			}
			if($("input[name='endDate']").val()==""){
				tip("请选择结束时间");
				return false;
			}
			
			if($("input[name='beginDate']").val()>=$("input[name='endDate']").val()){
				tip("开始时间不能晚于结束时间");
				return false;
			}
			return true;
		}
	</script>

 </body>
 